package com.gjy.service.es.controller;

import com.gjy.service.es.domain.vo.TermRequest;
import com.gjy.service.es.service.AggregationService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-07-03 15:06:13
 */
@RestController
@RequestMapping("/aggregation")
public class AggregationController {

    @Resource
    private AggregationService aggregationService;

    @PostMapping("/term")
    public Object term(@RequestBody TermRequest request) throws Exception {
        aggregationService.term(request.getIndex(), request.getTerm(), request.getValue());
        return "1";
    }

}
